package cn.yzfy.common.validate;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import cn.yzfy.common.validate.impl.UnifiedSocialCreditIdentifierValidatorImpl;

import java.lang.annotation.*;

/**
 * 验证统一社会信用代码
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
    validatedBy = {UnifiedSocialCreditIdentifierValidatorImpl.class}
)
public @interface ValidateUnifiedSocialCreditIdentifier {
  String message() default "统一社会信用代码格式错误";
  
  /**
   * 验证参数是否为必须的
   */
  boolean required() default true;
  
  Class<?>[] groups() default {};
  
  Class<? extends Payload>[] payload() default {};
}